package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DistrictCountyMapper;
import com.ruoyi.system.domain.DistrictCounty;
import com.ruoyi.system.service.IDistrictCountyService;

/**
 * 区县Service业务层处理
 * 
 * @author wfj
 * @date 2025-11-23
 */
@Service
public class DistrictCountyServiceImpl implements IDistrictCountyService 
{
    @Autowired
    private DistrictCountyMapper districtCountyMapper;

    /**
     * 查询区县
     * 
     * @param id 区县主键
     * @return 区县
     */
    @Override
    public DistrictCounty selectDistrictCountyById(String id)
    {
        return districtCountyMapper.selectDistrictCountyById(id);
    }

    /**
     * 查询区县列表
     * 
     * @param districtCounty 区县
     * @return 区县
     */
    @Override
    public List<DistrictCounty> selectDistrictCountyList(DistrictCounty districtCounty)
    {
        return districtCountyMapper.selectDistrictCountyList(districtCounty);
    }

    /**
     * 新增区县
     * 
     * @param districtCounty 区县
     * @return 结果
     */
    @Override
    public int insertDistrictCounty(DistrictCounty districtCounty)
    {
        districtCounty.setCreateTime(DateUtils.getNowDate());
        return districtCountyMapper.insertDistrictCounty(districtCounty);
    }

    /**
     * 修改区县
     * 
     * @param districtCounty 区县
     * @return 结果
     */
    @Override
    public int updateDistrictCounty(DistrictCounty districtCounty)
    {
        districtCounty.setUpdateTime(DateUtils.getNowDate());
        return districtCountyMapper.updateDistrictCounty(districtCounty);
    }

    /**
     * 批量删除区县
     * 
     * @param ids 需要删除的区县主键
     * @return 结果
     */
    @Override
    public int deleteDistrictCountyByIds(String[] ids)
    {
        return districtCountyMapper.deleteDistrictCountyByIds(ids);
    }

    /**
     * 删除区县信息
     * 
     * @param id 区县主键
     * @return 结果
     */
    @Override
    public int deleteDistrictCountyById(String id)
    {
        return districtCountyMapper.deleteDistrictCountyById(id);
    }
}
